Skip to content

Optimize truncated list check#64

Merged
aazuspan merged 2 commits intomainfrom
optimize-list
Mar 3, 2025
Merged

Optimize truncated list check#64
aazuspan merged 2 commits intomainfrom
optimize-list

Conversation

@aazuspan
Copy link
Copy Markdown
Owner

@aazuspan aazuspan commented Mar 3, 2025

Description

Instead of checking the minimum string length of every list to avoid stringifying truncated lists, just calculate the max list length once. Minor (probably negligible) performance improvement.

Checklist

  • I have updated the CHANGELOG with any added features, changes, fixes, or removals.

3 * (n - 1) + 3 reduces to 3 * n, and we can save a few CPU cycles
by calculating the max list length once instead of calculating the
minimum string length for each list.
@aazuspan aazuspan added the performance Optimizations that affect perforrmance but not functionality label Mar 3, 2025
@aazuspan aazuspan self-assigned this Mar 3, 2025
@aazuspan aazuspan merged commit 45f530d into main Mar 3, 2025
6 checks passed
@aazuspan aazuspan deleted the optimize-list branch April 17, 2025 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Optimizations that affect perforrmance but not functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant